- 
                Notifications
    You must be signed in to change notification settings 
- Fork 224
Setting default props for DaprClient #1567
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
966eb4f    to
    0ba7448      
    Compare
  
    There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
| @dapr/maintainers-java-sdk @dapr/approvers-java-sdk without setting these defaults, Spring Boot doesn't know where to find Dapr when running the application. This force the user to set the properties when they shouldn't. | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@salaboy I like the idea, however I think the endpoint syntax should be a little bit different. It should include the port as well.
I have looked in these places:
- GRPC endpoint - if ((grpcEndpoint != null) && !grpcEndpoint.isEmpty()) { 
- HTTP endpoint - return new DaprHttp(endpoint, apiToken, readTimeout, HTTP_CLIENT); 
In both of these places the expectation is that we provide the port as part of endpoint.
| import org.springframework.boot.context.properties.ConfigurationProperties; | ||
|  | ||
| @ConfigurationProperties(prefix = "dapr.client") | ||
| public class DaprClientProperties { | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wondering if an endpoints shouldn't have the port. As far as I remember there is some parsing logic in the network utils.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@artur-ciocanu yeah.. I have this constant feeling that this is not aligned all over the place.. but I didn't wanted to add more changes to this PR. Maybe we need another issue to track this alignment. Right now, this is just setting the default values.
|  | ||
| }); | ||
| } | ||
|  | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could remove unnecessary new lines.
| @salaboy I see that the build steps are timing out could you please check what might be the issue. Thank you! | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I second @artur-ciocanu's comments here - looks like its causing issues with CI - this should be resolved before its merged.
Signed-off-by: salaboy <Salaboy@gmail.com>
31968c2    to
    fd621f2      
    Compare
  
    | Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@             Coverage Diff              @@
##             master    #1567      +/-   ##
============================================
+ Coverage     76.91%   78.42%   +1.50%     
- Complexity     1592     1927     +335     
============================================
  Files           145      216      +71     
  Lines          4843     5872    +1029     
  Branches        562      658      +96     
============================================
+ Hits           3725     4605     +880     
- Misses          821      926     +105     
- Partials        297      341      +44     ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
 | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There looks to be an endpoint misalignment/misconfiguration going on causing CI to hang.
You may need to tweak things after confirming how the daprworkflowclient is constructed using the buildgrpcmanagedchannel. I think its coming from this file NetworkUtils.java as I see we have this check which might be were that 443 is coming from in the logs which would be the wrong port with this configuration:
        String parsedPort = matcher.group("port");
        if (parsedPort != null) {
          port = Integer.parseInt(parsedPort);
        } else {
          // This implements default port as 80 for http for backwards compatibility.
          port = http ? 80 : 443;
        }
Description
Setting the default values for DaprClient Spring Boot properties.
Issue reference
We strive to have all PR being opened based on an issue, where the problem or feature has been discussed prior to implementation.
Please reference the issue this PR will close: #1566
Checklist
Please make sure you've completed the relevant tasks for this PR, out of the following list: